//
//  ChartViewModel.m
//  Futures
//
//  Created by Cheng on 2017/6/22.
//  Copyright © 2017年 Cheng. All rights reserved.
//

#import "ChartViewModel.h"
#import "QuoteModel.h"

@implementation ChartViewModel
//传参：symbol,exchange
+ (void)requestQuoteWithSymbol:(NSString *)symbol exchange:(NSString *)exchange block:(void (^)(id obj))block{
    NSDictionary *dict = @{@"symbol":symbol,@"exchange":exchange};
    [Network requestDataMethod:GET WithUrl:URL_QUOTE parameters:dict success:^(NSURLSessionDataTask *task, id responseObject) {
        QuoteModel *model = [[QuoteModel alloc] initWithDict:responseObject];
        GLOBAL_INSTANCE.quoteModel = model;
        block(model);
    } failure:^(NSURLSessionDataTask *task, NSError *error) {
        MYLog(@"%@",error.description);
    }];
}

@end
